package cn.demoncat.util.lang.entity;

/**
 * Ticket Uri
 * 
 * @author 延晓磊
 *
 * @since 2018年5月28日
 */
public class TicketUri {

	private String uri;
	//级别(0 Token级别，1 UserId级别)
	private String level;
	
	/**
	 * 级别
	 * 
	 * @author 延晓磊
	 *
	 * @since 2018年5月28日
	 */
	public static class Level{
		public static final String TOKEN = "0";
		public static final String USER_ID = "1";
	}

	/**
	 * 构建绑定Token的Ticket
	 *
	 * @param url
	 * @return
	 */
	public static final TicketUri bindToken(String url){
		return new TicketUri(url, Level.TOKEN);
	}

	/**
	 * 构建绑定User的Ticket
	 *
	 * @param url
	 * @return
	 */
	public static final TicketUri bindUser(String url){
		return new TicketUri(url, Level.USER_ID);
	}

	public TicketUri(String uri, String level) {
		super();
		this.uri = uri;
		this.level = level;
	}
	
	public String getUri() {
		return uri;
	}
	public void setUri(String uri) {
		this.uri = uri;
	}
	public String getLevel() {
		return level;
	}
	public void setLevel(String level) {
		this.level = level;
	}
}
